﻿using BCDto.TMS.TrainingSite.TrainingSiteBusinessHours;
using BCService.TMS.TrainingSite.TrainingSiteBusinessHours;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace BCTMSRESTful.Controllers.Management.TMS.TrainingSite
{
    /// <summary>
    /// 培训点营业时间
    /// </summary>
    [ApiExplorerSettings(GroupName = "TMSAdmin")]
    [Route("api/v1/sim/[controller]")]
    public class TrainingSiteBusinessHoursController : ManagementBaseController
    {
        private readonly ITrainingSiteBusinessHoursService trainingSiteBusinessHoursService;

        public TrainingSiteBusinessHoursController(ITrainingSiteBusinessHoursService trainingSiteBusinessHoursService)
        {
            this.trainingSiteBusinessHoursService = trainingSiteBusinessHoursService;
        }

        /// <summary>
        /// 获取培训点营业时间
        /// </summary>
        /// <param name="trainingSiteConfigId">培训点配置ID</param>
        /// <param name="date">日期</param>
        /// <returns></returns>
        [HttpGet("[action]/{date}")]
        [ProducesResponseType(typeof(IEnumerable<TrainingSiteBusinessHoursDto>), 200)]
        [Obsolete]
        public IActionResult List([FromRoute(Name = "date")] DateTime date,
            [FromQuery(Name = "training_site_config_id")]long ? trainingSiteConfigId)
        {
            var result = this.trainingSiteBusinessHoursService.GetList(trainingSiteConfigId, date);
            return this.Ok(result);
        }
    }
}
